package bTree.LeetCode;

public class 对角线最长的矩形的面积 {
    public int areaOfMaxDiagonal(int[][] dimensions) {
        int maxLen=0;
        int maxS=0;
        for (int i = 0; i < dimensions.length; i++) {
            int[] dimension = dimensions[i];
            int len = dimension[0] * dimension[0] + dimension[1] * dimension[1];
            if (len>maxLen){
                maxLen=len;
                maxS=dimension[0]*dimension[1];

            }
            if (len==maxLen){
                maxS=Math.max(maxS,dimension[0]*dimension[1]);
            }
        }
        return maxS;
    }
}